#include "syscall.h"
int main() 
{
	BasicTests();
	Exit(0);
}

int BasicTests()
{
/*Tests the simple acts of a Lock
*/
	int lockNum;
	/*attempting to manipulate a lock that doesn't exist*/
	Acquire(lockNum);
	Release(lockNum);
	DestroyLock(lockNum);
	/*creating a lock to test*/
	lockNum=CreateLock("Lock Name",9);
	if(lockNum==0)
	{
		Write("Lock Created\n",13, ConsoleOutput );
	}
	Acquire(lockNum);
	Release(lockNum);
	DestroyLock(lockNum);
	/*make sure that you can't do anything with a deleted lock*/
	
	lockNum=CreateLock("Lock Name",9);
	if(lockNum==1)
	{
		Write("A new Lock Created\n",19, ConsoleOutput );
	}
	Acquire(lockNum);
	DestroyLock(lockNum);
	Release(lockNum);
	while(lockNum!=-1)
	{
		lockNum=CreateLock("Lock Names",10);
	}
	Write("Ran out of Locks\n",17, ConsoleOutput );
	return 0;
}